/*
This file is part of La Linea.

La Linea is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

La Linea is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with La Linea.  If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once
#ifndef ONELINECURVE_H
#define ONELINECURVE_H

#include "globals.h"

#include "Curve.h"
#include "Rectangle.h"

#include <deque>
#include <vector>

// Describe a line
// This is a set of curves being traced in one time
class OneLineCurve
{

private:
	std::deque<Curve*> _curves; // Curves constituting the line
	RectangleDesc _boundingBox;
	bool _validBoundingBox;
	
public:
	OneLineCurve(void);
	~OneLineCurve(void);
	
	// Return a copy of the OneLineCurve
	OneLineCurve* copy();

	// Get curves list
	std::deque<Curve*>& getCurves();
	
	// Add a curve to the line
	void addCurve(Curve* c);

	// Remove a curve from the line
	void removeCurve(Curve* c);

	// Replace the curve c1 by the curve c2
	void replaceCurve(Curve* c1, Curve* c2);

	// Draw the line
	void draw(GLfloat colorr = 1.0, GLfloat colorg = 1.0, GLfloat colorb = 1.0, GLfloat colora = 1.0, unsigned int options = DRAW_BORDERLINE);

	// Get the line's bouding box
	RectangleDesc getBoundingBox();

	// Generate and return the vertex list constituting the line
	std::vector<simple2DVertex>* getVertex();
};

#endif
